import { NestFactory } from '@nestjs/core';
import { AdminModule } from './admin.module';
import { ConfigureService } from '@app/configure';

async function bootstrap() {

	console.log('starting.....')
	const app = await NestFactory.create(AdminModule);
	
	const configure = app.get(ConfigureService)

	const apiPrefix = configure.get('API_PRE_FIX')
	const port = Number(configure.get('HTTP_PORT'))
	let url = 'http://localhost:' + port


	if(apiPrefix != undefined && apiPrefix.length > 0) {
		url += ('/' + apiPrefix)
		app.setGlobalPrefix(apiPrefix)
	}

	await app.listen(port);

	console.log('url:' + url)


	
}

bootstrap();
